import quest from '@/utils/request'
// import { getToken } from '@/utils/token'
// 获取所有频道接口
export const getAllChannelsApi = () => quest({
  url: '/v1_0/channels',
  method: 'get'

})
// 用户登录验证接口
export const loginApi = (data) => quest({
  url: '/v1_0/authorizations',
  method: 'post',
  data
})
// 获取用户接口
export const getUserChannelApi = () => quest({
  url: '/v1_0/user/channels'
})
// 文章-获取列表
export const getAllArticleListApi = (params) => quest({
  url: 'v1_0/articles',
  method: 'get',

  params
})
// 反馈不感兴趣接口
export const dislikeArticleApi = (id) => quest({
  url: 'v1_0/article/dislikes',
  method: 'post',

  data: {
    target: id
  }
})
// 反馈垃圾内容接口
export const reportArticleApi = (id, type) => quest({
  url: 'v1_0/article/reports',
  method: 'post',

  data: {
    target: id,
    type,
    remark: 'ccc'
  }
})
// 频道 - 更新已选
export const updateChannelAPI = ({ channels }) => {
  return quest({
    url: '/v1_0/user/channels',
    method: 'PUT',
    data: {
      channels: channels
    }
  })
}
// 频道-删除用户指定的频道
export const removeChannelApi = (channelId) => quest({
  url: `v1_0/user/channels/${channelId}`,
  method: 'DELETE'
})
